<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
	<head>
	    <link href="../../assets/commons.css?<?php echo time(); ?>" rel="stylesheet" type="text/css" />
		<link href="../../assets/grades.css?<?php echo time(); ?>" rel="stylesheet" type="text/css" />
    </head>
    <body>
    	<?php
			require_once '../../Helpers/DbHelper.php';
			require_once '../../Controllers/StudentController.php';
			require_once '../../Controllers/ReportCardController.php';
			if($_POST['btnUpdate'] == "Update")
			{
				$r = new ReportCardController();
				$id = $_POST['studentId'];
				$sy = $_POST['schoolYear'];
				$r->updateGrades($id, $sy, $_POST['grades']);
			}
			//http://localhost:8888/EnrolmentSystem/Views/ReportCards/read.php?studentId=6291&schoolYear=2010-2011&action=update
		?>

    	<?php require_once '../Partials/ReportCards/header.php'; ?>
    	<form method="post">
			<?php include '../Partials/ReportCards/grade.php'; ?>
            <table width="600" align="center">
            	<tr>
                <td align="right">
                	<input type="hidden" name="studentId" value="<?php echo $id; ?>" />
					        <input type="hidden" name="schoolYear" value="<?php echo $sy; ?>" />
					        <input type="hidden" name="action" value="update" />
	            	  <input type="submit" name="btnUpdate" value="Update" />
                </td>
                </tr>
            </table>
        </form>
    </body>
</html>